CC = gcc
CFLAGS = -Wall -pthread
TARGET = multi_thread_program
OBJS = main.o thread1.o thread2.o thread3.o thread4.o thread5.o thread6.o thread7.o thread8.o thread9.o

$(TARGET): $(OBJS)
	$(CC) -o $(TARGET) $(OBJS) $(CFLAGS)

main.o: main.c thread1.h thread2.h thread3.h thread4.h thread5.h thread6.h thread7.h thread8.h thread9.h
	$(CC) -c main.c $(CFLAGS)

thread1.o: thread1.c thread1.h
	$(CC) -c thread1.c $(CFLAGS)

thread2.o: thread2.c thread2.h
	$(CC) -c thread2.c $(CFLAGS)

thread3.o: thread3.c thread3.h
	$(CC) -c thread3.c $(CFLAGS)

thread4.o: thread4.c thread4.h
	$(CC) -c thread4.c $(CFLAGS)

thread5.o: thread5.c thread5.h
	$(CC) -c thread5.c $(CFLAGS)

thread6.o: thread6.c thread6.h
	$(CC) -c thread6.c $(CFLAGS)

thread7.o: thread7.c thread7.h
	$(CC) -c thread7.c $(CFLAGS)

thread8.o: thread8.c thread8.h
	$(CC) -c thread8.c $(CFLAGS)

thread9.o: thread9.c thread9.h
	$(CC) -c thread9.c $(CFLAGS)

clean:
	rm -f $(TARGET) $(OBJS) 